package com.ddn.controller.hall;

import com.ddn.service.hall.ReceptionService;
import com.ddn.util.ResultData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/*
  ❀❀❀---扎根---❀❀❀
    ❤ @libing ❤
  
*/
@RestController
@RequestMapping("/reception")
public class ReceptionController {
    @Autowired
    private ReceptionService receptionService;

    /**
     * 查找全部的洗浴信息
     * @param map
     * @return
     */
    @RequestMapping("/list")
    public ResultData listReception(@RequestParam HashMap<String, Object> map) {
        ResultData resultData = receptionService.findAllReception(map);
        return resultData;
    }

    /**
     * 删除洗浴信息
     * @param map
     * @return
     */
    @RequestMapping("/delete")
    public ResultData deleteReception(@RequestParam HashMap<String, Object> map) {
        ResultData resultData = receptionService.deleteReception(map);
        return resultData;
    }

    /**
     * 增加洗浴信息
     * @param map
     * @return
     */
    @RequestMapping("/add")
    public ResultData addReception(@RequestParam HashMap<String, Object> map) {
        ResultData resultData = receptionService.addReception(map);
        return resultData;
    }

    /**
     * 增加洗浴信息
     * @param map
     * @return
     */
    @RequestMapping("/update")
    public ResultData updateReception(@RequestParam HashMap<String, Object> map) {
        ResultData resultData = receptionService.updateReception(map);
        return resultData;
    }

    /**
     * 批量删除洗浴信息
     * @param ids
     * @return
     */
    @RequestMapping("/batch")
    public ResultData batchReception(@RequestParam List<Integer> ids) {
        System.out.println(ids);
        ResultData resultData = receptionService.batchReception(ids);
        return resultData;
    }
}
